import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Layout',
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Stack层叠布局')
        ),
        body: Stack(
          // 定位位置
          alignment: const FractionalOffset(0.5,0.1),
          children: [
            CircleAvatar(
              backgroundImage: new NetworkImage('https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg2.hx2car.com%2F78aeead0-9800-3cef-9606-8ae2a323fe5f_small_800_600.jpg&refer=http%3A%2F%2Fimg2.hx2car.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1642908540&t=aa79df43ddbfc973a223c4778562b8c2'),
              radius: 100.0,
            ),
            Text('定位文字'),
            // 单独自己定位 Positioned组件
            Positioned(
              top: 170.0,
              left: 90.0,
              width: 50.0,
              height: 30.0,
              child: Text('好车')
            )
          ],
        ),
      ),
    );
  }
}
